package ahblue.cn.tanzi.model.user;

import android.content.Context;
import android.widget.Toast;

import java.util.List;

import ahblue.cn.tanzi.data.source.ApiCallback;
import ahblue.cn.tanzi.data.source.RemoteRepository;

/**
 * Created by fengdongfei on 2018/12/15.
 */

public class CostModel {
    /**
     * id : 18
     * member_id : 20
     * order_sn : 201812142003769
     * out_oder_sn :
     * amount : 98
     * vip_type : quarter
     * payment_code : null
     * add_time : 1544754708
     * pay_time : 0
     * is_pay : 0
     * recharge_amount : 3
     * payment_time : null
     */

    public String id;
    public String member_id;
    public String order_sn;
    public String out_oder_sn;
    public String vip_type;
    public Object payment_code;
    public String add_time;
    public String pay_time;
    public String is_pay;
    public String desc ;
    public String recharge_amount;
    public Object payment_time;
    public static void getCost(final Context context , String token, final DataVertifyListener loginListener){
        RemoteRepository repo = RemoteRepository.getsInstance();
        repo.getCost(token, new ApiCallback<List<CostModel>>(){
            @Override
            public void onSuccess(List<CostModel> data) {
                if (null!=loginListener){
                    loginListener.conver(data);
                }
            }

            @Override
            public void onFailed(String errorMsg) {
                Toast.makeText(context,errorMsg,Toast.LENGTH_LONG).show();
                if (null!=loginListener){
                    loginListener.conver(null);
                }
            }
        });
    }


    public interface DataVertifyListener {
        void conver(List<CostModel> data);
    }


}
